package com.woniuxy.oa.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;

/**
 * @description:
 * @author: guohao
 * @time: 2019/12/25 11:22
 */
public interface RolePermDAO {
    /**
     * 增加角色权限中间表数据
     *
     * @param permId
     * @param roleId
     */
    @Insert("insert into oa_role_perm values(#{roleId},#{permId})")
    public void add(int permId, String roleId);

    /**
     * 根据角色id删除权限
     *
     * @param roleId
     */
    @Delete("delete from oa_role_perm op where op.roleId=#{roleId}")
    public void delByRoleId(String roleId);

    /**
     * 根据权限id删除权限
     *
     * @param permId
     */
    @Delete("delete from oa_role_perm re where re.permId=#{permId}")
    public void delByPermId(int permId);

}
